<template>
	<view>
		<!-- <fui-swiper-dot :items="bannerList"  :current="current" :styles="styles">
			<swiper class="fui-banner__wrap" @change="change" circular :indicator-dots="false" autoplay
				:interval="4000" :duration="150">
				<swiper-item v-for="(item,index) in bannerList" :key="index">
					<image :src="item.url" style="border-radius: 10rpx;width: 100%;height: 100%;"></image>
				</swiper-item>
			</swiper>
		</fui-swiper-dot> -->
		<u-swiper class="u-skeleton-fillet" :list="bannerList" @clikc="bannerClick" name="url" :height="304" :border-radius="10"></u-swiper>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				bannerList:[],
				current:0,
				styles: {
					width: 12,
					height: 12,
					activeWidth: 28,
					background: 'rgba(0,0,0,.3)',
					activeBackground: '#FFFFFF'
				},
			}
		},
		created(){
			this.getBannerList();
		},
		methods:{
			change(e) {
				this.current = e.detail.current;
			},
			async getBannerList(){
				const res = await this.$newHttp.get('api/v1.2/ShanNiang/GetBannerForPlantform');
				this.bannerList = res.data.bannerImages;
			},
			bannerClick(val){
				if(this.bannerList[val].linkObjetId!==0){
					if(this.bannerList[val].linkType ===1){
						this.$mRouter.push({
							route: '/pages/index/xiangqing?id=' + this.bannerList[val].linkObjetId 
						})
					}
					if(this.bannerList[val].linkType ===2){
						this.$mRouter.push({
							 route: '/pages/index/huodong?id=' + this.bannerList[val].linkObjetId 
						})
					}
				}
			},
		}
	}
</script>

<style>
	.fui-banner__wrap {
		height: 304rpx;
		/* margin-bottom: 20rpx; */
		border-radius: 10rpx;
		overflow: hidden;
	}
</style>
